from django.contrib import admin

from .models import CityInfo, OrgInfo, TeacherInfo


class CityInfoXadmin(admin.ModelAdmin):
    list_display = ["name", "add_time"]


class OrgInfoXadmin(admin.ModelAdmin):
    list_display = ["name", "image", "course_num", "study_num", "address", "love_num", "click_num", "category",
                    "add_time", ]
    style_fields = {'content': 'ueditor'}


class TeacherInfoXadmin(admin.ModelAdmin):
    list_display = ["image", "name", "work_year", "work_position", "age", "gender"]


admin.site.register(CityInfo, CityInfoXadmin)
admin.site.register(OrgInfo, OrgInfoXadmin)
admin.site.register(TeacherInfo, TeacherInfoXadmin)

from django.contrib import admin


class PostAdmin(admin.ModelAdmin):
    list_display = ['title', 'zhaiyao', 'created_time', 'modified_time', 'category', 'author']

    class Media:
        js = [
            '/static/tinymce/js/jquery.min.js',  # 必须首先加载的jquery，手动添加文件
            '/static/tinymce/js/tinymce/tinymce.min.js',  # tinymce自带文件
            '/static/tinymce/js/tinymce/plugins/jquery.form.js',  # 手动添加文件
            '/static/tinymce/js/tinymce/textarea.js',  # 手动添加文件，用户初始化参数
        ]
# Register your models here.
